package pnlMain;

import java.awt.Color;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import pnlSwitch.RBPanelSwitcher;
import pnlSwitch.PnlSystemController;
import controller.ControlWelkom;


public class PnlWelkom extends JPanel{

	
	/**
	 * 
	 */
	
	private static final long serialVersionUID = 3770799834310661649L;

	
		JPanel p;		
		JButton btnRbeh;
		JButton btnBbeh;
		JLabel lblWel;
		JLabel lblLogo;
		ImageIcon bgimg;
		ImageIcon imgr;
		ImageIcon imgb;
		
		JButton btnExit;
	
		ControlWelkom cw;
		RBPanelSwitcher cps;
		PnlSystemController cpsys;


		private ImageIcon imgExit;
		
		public PnlWelkom(){
			
			this.cw = new ControlWelkom(this);
			this.cps = new RBPanelSwitcher(this);
			this.cpsys = new PnlSystemController(this);
			
			setBackground(Color.pink);
	        setSize(1365,725);
	        setLayout(null);
	        setVisible(true);
	        
	        imgr = new ImageIcon(getClass().getResource("/image/reta.gif"));
			btnRbeh = new JButton("Restaurant beheer",imgr);
			btnRbeh.setHorizontalTextPosition(JButton.CENTER);
			btnRbeh.setVerticalTextPosition(JButton.TOP);
			btnRbeh.setBounds(1150, 50, 200, 200);
			btnRbeh.setLayout(null);
			btnRbeh.addActionListener(cw);
			btnRbeh.setActionCommand("RB");
			add(btnRbeh);
			
			
			imgb = new ImageIcon(getClass().getResource("/image/boekh.gif"));
			btnBbeh = new JButton("Boekhouding beheer",imgb);
			btnBbeh.setHorizontalTextPosition(JButton.CENTER);
			btnBbeh.setVerticalTextPosition(JButton.TOP);
			btnBbeh.setBounds(1150, 330, 200, 200);
			btnBbeh.setLayout(null);
			btnBbeh.addActionListener(cw);
			btnBbeh.setActionCommand("BB");
			add(btnBbeh);
			
			lblWel = new JLabel();
			lblWel.setText("<html><h1><b>Welkom</b></h1></html>");
			lblWel.setBounds(630, 200, 300, 100);
			lblWel.setLayout(null);
			add(lblWel);
			
			bgimg = new ImageIcon(getClass().getResource("/image/Daxin.gif"));
			lblLogo = new JLabel(bgimg);
			lblLogo.setBounds(520,0,300,400);
			add(lblLogo);
			
			imgExit = new ImageIcon(getClass().getResource("/image/exit.png"));
        	btnExit = new JButton("Exit program",imgExit); 
        	btnExit.setBounds(1150, 610, 200, 70);
        	btnExit.addActionListener(cpsys);
        	btnExit.setActionCommand("exit");
        	add(btnExit);
        	
		}
		public JButton getbtnRbeh(){
			return btnRbeh;
	}
}
